//渲染功能：渲染图片，音乐信息，是否喜欢

;(function (root) {
    //渲染图片
    function renderImg(src) {
        root.blurImg(src);
        const img = document.querySelector('.songImg img');
        img.src = src;
    }

    //音乐信息
    function renderInfo(data) {
        const songInfoChildren = document.querySelector('.songInfo').children;
        songInfoChildren[0].innerHTML = data.name;
        songInfoChildren[1].innerHTML = data.singer;
        songInfoChildren[2].innerHTML = data.album;
    }

    //是否喜欢
    function renderIslike(isLike) {
        var lis = document.querySelectorAll(".control li");
        lis[0].className = isLike ? "liking" : "";
    }

    root.render = function (data) { //data为请求过来的数据
        renderImg(data.image);
        renderInfo(data);
        renderIslike(data.isLike);
    };

})(window.player || (window.player = {}));